//对话面板
var DIALOGUE_WIDTH = 600;
var DIALOGUE_HEIGHT = 200;
var TEXT_MARGIN = 120;
var TEXT_OFFSET = 40;
var Dialogue = function( scene, left, top ){
	var tray = scene.area( {
		left: left,
		top: top,
		width: DIALOGUE_WIDTH,
		height: DIALOGUE_HEIGHT
	} );
	var back = Box( tray, {
		background_image: "url(img/dialogue.png)",
		width: DIALOGUE_WIDTH,
		height: DIALOGUE_HEIGHT,
		left: 0,
		top: 0
	} );
	var txt = Label( tray, {
		text: "",
		width: DIALOGUE_WIDTH-2*TEXT_MARGIN,
		left: TEXT_MARGIN,
		top: TEXT_OFFSET
	} );
	return {
		remove: tray.remove,
		left: tray.left,
		top: tray.top,
		text: txt.text
	};
};

//头像
var PORTRAIT_WIDTH = 200;
var PORTRAIT_HEIGHT = 240;
var Portrait = function( scene, left, top ){
	var port = Box( scene, {
		width: PORTRAIT_WIDTH,
		height: PORTRAIT_WIDTH,
		left: left,
		top: top
	} );
	return {
		remove: port.remove,
		left: port.left,
		top: port.top,
		background_image: port.background_image
	};
};